<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .active{
            border:1px solid red;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- <img :src="imgSrc" alt="正在加载..." :title="imgTitle+'!!'" :class="isActive?'active':''"  @click="change"> -->
        <br>
        <img :src="imgSrc" alt="正在加载..." :title="imgTitle+'!!'" :class="{active:isActive}"  @click="change">
    </div>
    <script> 
       // v-bind 为元素绑定属性 
        var app= new Vue({ 
            el:"#app",
            data:{
               imgSrc:"http://www.itheima.com/images/logo.png",
               imgTitle:'证件照',
               isActive:false
            },
            methods: {
               change:function(){
                   this.isActive = ! this.isActive;
               }
            }, 
        });

    </script>
</body>
</html>